package com.test.beans;

import java.util.Locale;

public class Name {

    private String en;
    private String cs;
    private String jp;
    private String kr;
    private String fr;
    private String es;
    private String ru;
    private String it;
    private String de;
    private String pt;
    private String ct;
    private String id;

    public String getEn() {
        return en;
    }

    public String getCs() {
        return cs;
    }

    public String getJp() {
        return jp;
    }

    public String getKr() {
        return kr;
    }

    public String getFr() {
        return fr;
    }

    public String getEs() {
        return es;
    }

    public String getRu() {
        return ru;
    }

    public String getIt() {
        return it;
    }

    public String getDe() {
        return de;
    }

    public String getPt() {
        return pt;
    }

    public String getCt() {
        return ct;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        if (curSysLanguage() == LAN_CHINESE) {
            return getCs();
        } else if (curSysLanguage() == LAN_JAPANESE) {
            return getJp();
        } else if (curSysLanguage() == LAN_KOREAN) {
            return getKr();
        } else if (curSysLanguage() == LAN_FRENCH) {
            return getFr();
        } else if (curSysLanguage() == LAN_GERMAN) {
            return getDe();
        } else if (curSysLanguage() == LAN_ITALIAN) {
            return getIt();
        } else if (curSysLanguage() == LAN_SPANISH) {
            return getEs();
        } else if (curSysLanguage() == LAN_BRAZIL) {
            return getPt();
        } else if (curSysLanguage() == LAN_RUSSIAN) {
            return getRu();
        } else if (curSysLanguage() == LAN_TAIWAN) {
            return getCt();
        } else if (curSysLanguage() == LAN_INDONESIA) {
            return getId();
        } else {
            return getEn();
        }
    }

    public static int curSysLanguage() {
        int st_nSysLanguage = LAN_ENGLISH;
        Locale locale = Locale.getDefault();
        String language = locale.getLanguage().toLowerCase(Locale.US);
        if (language != null) {
            if (language.compareTo("zh") == 0) {
                if (locale.toString().startsWith("zh_CN")) {
                    st_nSysLanguage = LAN_CHINESE;
                } else if (locale.toString().startsWith("zh_TW")) {
                    st_nSysLanguage = LAN_TAIWAN;// Locale.TRADITIONAL_CHINESE
                } else {
                    st_nSysLanguage = LAN_ENGLISH;//zh_HK,zh_SG,etc
                }
            } else if (language.compareTo("en") == 0) {
                st_nSysLanguage = LAN_ENGLISH;
            } else if (language.compareTo("ja") == 0) {
                st_nSysLanguage = LAN_JAPANESE;
            } else if (language.compareTo("ko") == 0) {
                st_nSysLanguage = LAN_KOREAN;
                // } else if (language.compareTo("ar") == 0) {
                // st_nSysLanguage = MakeupApp.Arabic;
                // } else if (language.compareTo("hi") == 0) {
                // st_nSysLanguage = MakeupApp.Hindi;
            } else if (language.compareTo("pt") == 0) {
                st_nSysLanguage = LAN_BRAZIL;
            } else if (language.compareTo("de") == 0) {
                st_nSysLanguage = LAN_GERMAN;
            } else if (language.compareTo("it") == 0) {
                st_nSysLanguage = LAN_ITALIAN;
            } else if (language.compareTo("ru") == 0) {
                st_nSysLanguage = LAN_RUSSIAN;
            } else if (language.compareTo("es") == 0) {
                st_nSysLanguage = LAN_SPANISH;
            } else if (language.compareTo("fr") == 0) {
                st_nSysLanguage = LAN_FRENCH;
            } else if (language.compareTo("in") == 0) {
                st_nSysLanguage = LAN_INDONESIA;
            } else
                st_nSysLanguage = LAN_ENGLISH;
        }
        return st_nSysLanguage;
    }

    public static final int LAN_CHINESE = 0;
    public static final int LAN_ENGLISH = 1;
    public static final int LAN_JAPANESE = 2;
    public static final int LAN_KOREAN = 3;
    // public static final int Arabic = 4;
    // public static final int Hindi = 5;
    public static final int LAN_BRAZIL = 6;
    public static final int LAN_GERMAN = 7;
    public static final int LAN_ITALIAN = 8;
    public static final int LAN_RUSSIAN = 9;
    public static final int LAN_SPANISH = 10;
    public static final int LAN_FRENCH = 11;
    public static final int LAN_TAIWAN = 12;
    public static final int LAN_INDONESIA = 13;
}
